#include<stdio.h>
int main()
{
	int year;
	int mouth;
	int day;
	int sum=0;
	int flag=0,isprime=0;
	for(year=2023;year<=2050;year++){
		for(mouth=3;mouth<=12;mouth++){
			for(day=1;day<=31;day++){
				if(mouth==4||mouth==6||mouth==9||mouth==11){
					if(day>30){
						break;
					}
				}
				if(mouth==2){
					if((year%4==0&&year/100!=0)||year%400==0){
						if(day>29){
							break;
						}
					}
					else{
						if(day>28){
							break;
						}
					}
				}
				if(isprime) sum++;
				if(year==2023&&mouth==3&&day==25){
					isprime=1;
				}
				//if(isprime) sum++;
				
				if(year==2023&&mouth==5&&day==1){
				flag=1;
				break;
			}
			//if(flag) break;
		}
		if(flag) break;
		}
		if(flag) break;
		//printf("%d\n",sum);
		if(flag) break;
	}
	printf("%d\n",sum);
	return 0;
}
